// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   ViewProfileAction.java

package com.boci.clientapp.profile.action;

import com.boci.clientapp.main.ApplicationService;
import com.boci.clientapp.profile.EditProfileDialog;
import com.boci.clientapp.profile.ViewProfileDialog;
import com.boci.clientapp.profile.handler.AccountProfileHandler;
import com.boci.common.action.AbstractAction;
import com.boci.common.constant.RequestTypeConst;
import com.boci.common.util.AppException;
import com.boci.common.util.StringUtil;
import java.util.HashMap;
import java.util.logging.Logger;

public class ViewProfileAction extends AbstractAction
{

    public ViewProfileAction()
    {
    }

    private void addExtraValues(HashMap pInpMap)
    {
        pInpMap.put("testValue", "account");
    }

    public void doProcess(HashMap pInpMap, String pActionType)
    {
    	try{
	        appServ.setBusy(true);
	        ViewProfileDialog viewProfileDialog = appServ.getViewProfileDialog();
	        if(pActionType.equals("UPDATE"))
	        {
	            appServ.getEditProfileDialog().refresh(viewProfileDialog.getAccountProfileVO());
	            viewProfileDialog.showDialog(false);
	            appServ.showEditProfileDialog(true);
	        } else
	        if(pActionType.equals("CLOSE"))
	            viewProfileDialog.showDialog(false);
	        else
	        if(pActionType.equals("REFRESH"))
	        {
	            addExtraValues(pInpMap);
	            AccountProfileHandler handler = new AccountProfileHandler(RequestTypeConst.BOCI_ACCT_PROF_REVW_URL);
	            com.boci.common.vo.ResponseVO vo = handler.getAccountProfile(pInpMap);
	            viewProfileDialog.refresh(vo);
	        }
    	}
        catch(AppException appEx)
        {
            appServ.showErrorDialog(null, appEx.getMessage());
            appServ.showViewProfileDialog(false);
        }
        catch(Exception sysEx)
        {
            logger.severe(StringUtil.formatException(sysEx));
            appServ.showSysErrDialog();
            appServ.showViewProfileDialog(false);
        }
        finally
        {
            appServ.setBusy(false);
        }
        return;
    }
}
